home *** CD-ROM | disk | FTP | other *** search
- #include <workbench/startup.h>
- #include <libraries/asl.h>
- #include <clib/asl_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
- #include "bbs.h"
- extern int rzmsg;
- int asl(char *s)
- {
- struct FileRequester *fr;
- struct WBArg *frargs;
- char src[100];
-
- int x;
- fr=(struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
- ASL_Window, MYwindow,
- ASL_Hail,(ULONG)"/X FileRequest",
- ASL_Pattern,(ULONG)"#?",
- ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
- ASL_Dir,(ULONG)&(Cmds->BBSLoc),
- TAG_DONE);
-
- if(AslRequest(fr,0L))
- {
- /* if(fr->rf_NumArgs)
- {
- frargs=fr->rf_ArgList;
-
- for(x=0;x<fr->rf_NumArgs;x++){
- sprintf(temp,"Argument %d: PATH=%s FILE=%s",
- x,fr->rf_Dir,frargs[x].wa_Name);sm(temp,1); }
- }
- else {*/
- strcpy(src,fr->rf_Dir);
- if(src[strlen(src)-1]!=':') sprintf(src,"%s/%s",fr->rf_Dir,fr->rf_File);
- else sprintf(src,"%s%s",fr->rf_Dir,fr->rf_File);
- strcpy(s,src);
- //}
- }
- FreeAslRequest(fr);
- }
-
- int batchasl(char *where)
- {
- struct FileRequester *fr;
- struct WBArg *frargs;
- char src[102];
- char dest[102];
- int x;
- int returnval;
- fr=(struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
- ASL_Window, MYwindow,
- ASL_Hail,(ULONG)"/X Local Upload FileRequest",
- ASL_Pattern,(ULONG)"#?",
- ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
- ASL_Dir,(ULONG)&(Cmds->BBSLoc),
- TAG_DONE);
- returnval=0;
- AEPutStr("\r\nBatch Local upload in progress, Please Standy!\r\n");
- if(AslRequest(fr,0L))
- {
-
- returnval=(fr->rf_NumArgs)+1;
- AEPutStr("\r\n");
- if(fr->rf_NumArgs)
- {
- frargs=fr->rf_ArgList;
-
- for(x=0;x<fr->rf_NumArgs;x++){
- strcpy(src,fr->rf_Dir); AddPart(src,frargs[x].wa_Name,100L);
- strcpy(dest,where);
- AddPart(dest,frargs[x].wa_Name,100L);
- if(!rzmsg && Check_For_File(frargs[x].wa_Name))
- {
- AEPutStr("File "); AEPutStr(frargs[x].wa_Name); AEPutStr(" already exists\r\n");
- }else
- {
- AEPutStr("Copying ");
- AEPutStr(frargs[x].wa_Name); AEPutStr("\r\n");
- FileCopy(src,dest);
- }
- }
- }
- else {
- strcpy(src,fr->rf_Dir); AddPart(src,fr->rf_File,100L);
- strcpy(dest,where);
- AddPart(dest,fr->rf_File,100L);
- if(!rzmsg && Check_For_File(fr->rf_File))
- {
- AEPutStr("File "); AEPutStr(fr->rf_File); AEPutStr(" already exists\r\n");
- }else
- {
- AEPutStr("Copying ");
- AEPutStr("\r\n");
- AEPutStr(fr->rf_File);
- FileCopy(src,dest);
- }
- }
- }
- FreeAslRequest(fr);
- return(returnval);
- }
-
-